package cn.net.bhb.base.base;

import android.graphics.Color;
import android.os.Bundle;

import com.hannesdorfmann.mosby3.mvp.MvpActivity;
import com.hannesdorfmann.mosby3.mvp.MvpPresenter;
import com.hannesdorfmann.mosby3.mvp.MvpView;
import com.jaeger.library.StatusBarUtil;

import androidx.annotation.LayoutRes;

/**
 * 所有的Activity继承此类
 */
public abstract class BaseActivity<V extends MvpView, P extends MvpPresenter<V>> extends MvpActivity<V, P> {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(getLayoutId());
//        ButterKnife.bind(this);
        StatusBarUtil.setLightMode(this);
        StatusBarUtil.setColorNoTranslucent(this, Color.WHITE);
        initView();
        initData();
        initListener();
    }

    public abstract @LayoutRes
    int getLayoutId();

    /**
     * @return 方便用在友盟统计是哪个页面
     */
    protected abstract String initView();

    protected abstract void initData();

    protected abstract void initListener();

}

